<script setup lang="ts">

import {onMounted, ref} from "vue";

const root = ref(null);


// DOM首次渲染完成以后才能获取到真是的Dom
onMounted(() => {
  console.log(root.value);
})

</script>

<template>
  <h1>TeamplatRefs使用</h1>
  <hr>
  <input type="text" ref="root" value="测试文本">
</template>

<style scoped>

</style>